<!DOCTYPE html>
<!-- saved from url=(0022)http://www.hasbei.com/ -->
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" href="/css/amazeui.min.css">
    <link rel="stylesheet" href="/css/amazeui.cropper.css">
    <link rel="stylesheet" href="/css/custom_up_img.css">

    <link rel="stylesheet" media="screen and (min-width:481px)" href="/css/usercenter.css">
    <link rel="stylesheet" media="screen and (max-width:480px)" href="/css/usercenter(1).css">
    <script src="/js/hm.js"></script>
    <script src="/js/hm(1).js"></script>
    <script type="text/javascript">var basePath = "/";</script>
    <script src="/js/common.js"></script>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/js/footfixed.js"></script>
    <script src="/js/layer.js"></script>
    <script src="/js/amazeui.min.js"></script>
    <script src="/js/cropper.min.js"></script>
    <script src="/js/custom_up_img.js"></script>
    <link rel="stylesheet" href="/css/layer.css" id="layuicss-layer">
    <title>usercenter_head</title>
</head>
<body>
    <div class="content-top" th:fragment = "usercenterhead">
        <div class="content-top-info">
            <div class="content-top-left">
                <div class="left-logo">
                    <a href="http://localhost:8000/index" class="logo-info" target="_self"><img src="/icon/logo.png" alt="有贝口腔网"></a>
                </div>
                <ul class="right-list">
                    <li th:class="${type == 'zx'?'right-list-active':''}">
                        <a href="/zx" target="_self">
                            <img src="/icon/news-icon.png" alt="有贝口腔网">
                            <span>资讯</span>
                        </a>
                    </li>
                    <li th:class="${type == 'qa'?'right-list-active':''}">
                        <a href="/answers/main/-1/0" target="_self">
                            <img src="/icon/qa-icon.png" alt="有贝口腔网">
                            <span>问答</span>
                        </a>
                    </li>
                </ul>
            </div>
            <form action="http://www.hasbei.com/search" method="get">
                <div class="content-top-right">
                    <div class="search-input">
                        <img class="search-icon" src="/icon/icon_Search.png">
                        <input class="top-search" type="text" name="kw" placeholder="请输入资讯、问题搜索" value="">
                        <input class="search-sub" type="submit" value="搜索">
                    </div>
                    <div class="land-success" id="land-success"  th:if="${loginUser != null}">
                        <div class="message-notice">
                            <a th:text="${mesgCount}"></a>
                            <a href="/user_page/userindex"><img src="/icon/notice.png" alt="有贝口腔网"><span class="notice-tip" id="msgCount" style="display:none" th:text="${mesgCount}"></span></a>
                            <div class="notice-modul" id="myNoticeModul"><a href="/user_page/usermsg">站内消息<span class="tips-num" th:text="${mesgCount}"></span></a></div>
                        </div>

                        <div class="land-success-img" th:if="${loginUser}">
                            <a href="/user_page/userindex" title="${loginUser.u_name}">
                                <img th:src="@{${loginUser.u_img_url}}">
                                <span class="land-success-name" th:text="${loginUser.u_name}"></span>
                            </a>
                            <div class="img-posi-div">
                                <a href="/user_page/userindex"><span>个人信息</span></a>
                                <a href="javascript:;" onclick="loginOut()"><span>退出登录</span></a>
                            </div>
                        </div>
                    </div>
                    <div class="land-regist"  th:if="${loginUser == null}">
                        <a class="top-land" href="/login">登录</a>
                        <span></span>
                        <a class="top-regist" href="/zhuce">注册</a>
                    </div>
                </div>
                <script type="text/javascript">
                    function loginOut(){//退出登录
                        $.get("/login/out", function(data){
                            if(data.success){
                                layer.msg(data.msg);
                                window.location.href="/login";
                            }else{
                                layer.msg(data.msg);
                            }
                        });
                    }
                    $(function inituser() {
                        var uid = "";
                        //获取cookie
                        var cookieArray = document.cookie;//所有的cookie数组
                        var arr = cookieArray.split(";")//获得每个独立的cookie
                        for (var i = 0; i < arr.length; i++) {
                            var arr1 = arr[i].split("=");//将key value分开
                            var name =arr1[0].replace(" ", "");
                            var value =arr1[1].replace(" ", "");
                            if(name === "loginUserId"){
                                uid = value;
                            }
                        }
                    })
                </script>
            </form>
        </div>
    </div>
</body>
</html>